<?php
/**
 * Created by PhpStorm.
 * User: chenzhitao
 * Date: 2018/1/25
 * Time: 下午8:05
 */

namespace App\Busi\Traits;


use App\Models\FooterTab;

Trait FooterTabTrait
{
    function getFooterTabList(){
        $where = [
            ['flag','=',1]
        ];
        $fields = ['tab_id','title','select_poster','unselect_poster'];
        $data = FooterTab::where($where)->select($fields)->get();
        if($data->isNotEmpty()){
            $data = $data->toArray();
            foreach ($data as &$item){
                $item['select_poster'] =  config('admin.upload.host') .'/'. $item['select_poster'];
                $item['unselect_poster'] =  config('admin.upload.host') .'/'. $item['unselect_poster'];
            }
        }
        return $data;
    }

}